package com.vanke.kotlin_mvp.main

import android.content.Context
import android.support.v4.view.ViewCompat
import android.support.v4.widget.SwipeRefreshLayout
import android.util.AttributeSet
import android.view.View

/**
 * @name Kotlin_MVP
 * @package name：com.vanke.kotlin_mvp.main
 * @class describe
 * @anthor shiyuchuan
 * @time 2017/8/21 15:48
 */
class ScrollChildSwipeRefreshLayout constructor(context: Context,attributeSet: AttributeSet? =null) :
        SwipeRefreshLayout(context,attributeSet) {
    var scrollUpChild: View? = null

    override fun canChildScrollUp(): Boolean {
        if (scrollUpChild != null) {
            return ViewCompat.canScrollVertically(scrollUpChild,-1)
        }
        return super.canChildScrollUp()
    }
}